function [updown] = transformedtwouponedown(acc)
% Compute the change to make on the stimulus based on accuracy
persistent prev
if acc(end) == 0
    % error increases stepsize
    updown = +1;
elseif length(acc)<=1
    updown = 0;
else   
    if acc(end-1) && prev == 0;
        updown = -1;
    else 
        updown = 0;
    end
end    
prev = updown;
